require "wondercap/lib/deployment/model/area"

extension :runtime_dependencies => :current_local_snapshot do
  set(:_current_deployment) do
    area = Wondercap::Deployment::Area.find_by_name("local")
    raise "no current snapshot" unless area && area.current_snapshot
    dep = area.current_snapshot.find_deployment_by_name(project_name)
    raise "no deployment for #{project_name} found" unless dep
    dep    
  end
  task :fill_runtime_dependencies do
    set :runtime_dependencies, _current_deployment.runtime_dependencies
  end
end
